package ebj.common;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.HttpException;

import com.dianping.cat.Cat;

import ebj.common.utils.Http;
import ebj.common.utils.StringUtils;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) throws UnsupportedEncodingException
    {
    	 String postData = "[truncated] sn=1&sm=QAAAAAAAAABkQyDRwG_W8daOKkBwWoZ8MTy15EYy5pEIKrFLwZSWnpU8L6hFBvwR7irGlLRpHROb%0AfVgKuk8TWehRVh483lFwsAQAAAAAAAAwaKm4nTSftiuxkK2Bw8e27hXJk_Qi5gVNfNRq27iKDPLu%0AP1eGvKw4rYi7KDmFHjrjcRT-QGzOHkvxeHPSn04TNDWG9qRIxH4g0KEM0nQA2";
//    	String postData = "sn=1&sm=QAAAAAAAAADMLDpb_lR4sWrNtJsc7w23Csr-sw_rAtXrEOzNMQ05Gup8XwZr6cnnVub2DaeIwman%0AroGLUtQToa3qchvnDiUd0AMAAAAAAADQVxB5YUYTxgP6nZ846G_kR7um_NA9WjL5aPKT1IznryYl%0Ahzl436NjJwnvpgCzzt124ACxNcLOmjDf2IijSzaEvNlSWSTPQ1LbjlG5l_w1XSzGh6IkXT3zMnfN%0ABDSHlsPx0KV7e6q0ND7Eyj_Rt3z8EYw5Thtwrmjo5Z3YVzXcY5Ft3rna4BBJN1MU2qRkJ3E62L66%0AJMarfgEmj5dWsAvnEo0drzWdb9PHv8iL7p00n_1wa41BQvIf9DGr2ryHfY8u4TisI8RR70Q_mXHZ%0ATo-DdP7d_Wy2Sdg7OYuYG0nAw6VgKWNSE_XWQ3xZgPa1IVXLdNDoaRtQc35x_GXZis3DoXU1er06%0AH8nJGDaV5T6N_11ulr1XhcD7qJNCuNpuEQi39oJNPiC-Zy2uRS5p8Iyev1AEvjYIOQoGVI7zaMjy%0A6b9IwhwaJ2bybJ0gGgaVCd3WfctqLPKNQwfseWCTz37UXwoSk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9ev5NKWX7oiMufDd1Z1zUvcpjKB3Y7HIEzDh7RBbBM8kuqtvlnKbL5cjQm4QOHmR30ecGTOtBEhrmOyioq8ec5nUtNgjyjjsNyoIEvn-70XkmwPuZjbjFpg2rpLeCnmipEBginIoAi_g3qucGgdzcSaHNy5RIc8jKn8sRuy9IADzHYmye1ooCqiarWMPp2HizwKrnsrU3xsssBjpl_-3IAeMW3bkWGj8gg45ZBugAMgsKKyhC3DmNOeQAuXJtJwNjF-0BDvXJWkJeyi4lzA0Zfk7Ps8HoEYXW3XYwTXbuOmfGGLvCAKToSSukPMncbbIBgY0udlzOlw-RMUrebYJgzPs-yk5i7Mj7tso_qsEK8aABTDjYeuymG2lsDnTAO1GRH7ub0BjXX619xZLJ4cRdbrM_Itu4DwtEB9yKnbn9I-yhG-Y4jMQaKldRdbmQ949u0YRUnFpUJ5nR05hDnlC1fxydkUD12cyuyJ7qghB7QyLrhN4G5t2E8aVKp441mDUMAvLvYEUi1cq8DcJ8wPhoV5INcLMF1wMkWmK7olyLb0T1q22_XC3bm5qZLS4gGpbWSGEzaieC-tXQa1eexjLU7FAAAAAAAAACmquJDh4bEgXgPbtcHuaTHptfdjg==";
    	System.out.println(Base64.isBase64(dd));
    	System.out.println(Base64.decodeBase64(dd));
        System.out.println( "Hello World!" );
        
        String a = "sss";
        String b = new String("sss");
        System.out.println(a == b );
        String urlString = "http://my.mobfox.com/request.php?rt=android_app&v=6.1.0&i=fe80%3A%3A9%3A4cff%3Afe83%3Ae8dc%25p2p0&u=Dalvik%2F1.6.0%20(Linux%3B%20U%3B%20Android%204.4.4%3B%20X98%20Air%20II(HG5N)%20Build%2FKTU84P)&u2=Mozilla%2F5.0%20(Linux%3B%20U%3B%20Android%204.4.4%3B%20zh-cn%3B%20X98%20Air%20II(HG5N)%20Build%2FKTU84P)%20AppleWebKit%2F533.1%20(KHTML%2C%20like%20Gecko)%20Version%2F4.0%20Mobile%20Safari%2F533.1&s=e598249839d194fcf71b5ccc50e5a516&o_andadvid=82dd525a2afea756&o_andadvdnt=0&r_random=18419&t=1434608922058&connection_type=UNKNOWN&listads=&c_customevents=1&c_mraid=1&r_type=banner&u_wv=Dalvik%2F1.6.0%20(Linux%3B%20U%3B%20Android%204.4.4%3B%20X98%20Air%20II(HG5N)%20Build%2FKTU84P)&u_br=Dalvik%2F1.6.0%20(Linux%3B%20U%3B%20Android%204.4.4%3B%20X98%20Air%20II(HG5N)%20Build%2FKTU84P)&adspace_strict=0&adspace_width=320&adspace_height=480";
        System.out.println(URLDecoder.decode(urlString, "UTF-8"));
        try {
			String result = Http.get(urlString);
			System.out.println("result = " + result);
		} catch (HttpException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        
        Cat cat = Cat.getInstance();
    }
}
